package com.traffic.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.traffic.mapper.PerLeaveCancellationRequestsMapper;
import com.traffic.domain.PerLeaveCancellationRequests;
import com.traffic.service.IPerLeaveCancellationRequestsService;

/**
 * 销假申请Service业务层处理
 * 
 * @author 郭世纪
 * @date 2024-12-08
 */
@Service
public class PerLeaveCancellationRequestsServiceImpl implements IPerLeaveCancellationRequestsService 
{
    @Autowired
    private PerLeaveCancellationRequestsMapper perLeaveCancellationRequestsMapper;

    /**
     * 查询销假申请
     * 
     * @param cancellationRequestId 销假申请主键
     * @return 销假申请
     */
    @Override
    public PerLeaveCancellationRequests selectPerLeaveCancellationRequestsByCancellationRequestId(Long cancellationRequestId)
    {
        return perLeaveCancellationRequestsMapper.selectPerLeaveCancellationRequestsByCancellationRequestId(cancellationRequestId);
    }

    /**
     * 查询销假申请列表
     * 
     * @param perLeaveCancellationRequests 销假申请
     * @return 销假申请
     */
    @Override
    public List<PerLeaveCancellationRequests> selectPerLeaveCancellationRequestsList(PerLeaveCancellationRequests perLeaveCancellationRequests)
    {
        return perLeaveCancellationRequestsMapper.selectPerLeaveCancellationRequestsList(perLeaveCancellationRequests);
    }

    /**
     * 新增销假申请
     * 
     * @param perLeaveCancellationRequests 销假申请
     * @return 结果
     */
    @Override
    public int insertPerLeaveCancellationRequests(PerLeaveCancellationRequests perLeaveCancellationRequests)
    {
        return perLeaveCancellationRequestsMapper.insertPerLeaveCancellationRequests(perLeaveCancellationRequests);
    }

    /**
     * 修改销假申请
     * 
     * @param perLeaveCancellationRequests 销假申请
     * @return 结果
     */
    @Override
    public int updatePerLeaveCancellationRequests(PerLeaveCancellationRequests perLeaveCancellationRequests)
    {
        perLeaveCancellationRequests.setUpdateTime(DateUtils.getNowDate());
        return perLeaveCancellationRequestsMapper.updatePerLeaveCancellationRequests(perLeaveCancellationRequests);
    }

    /**
     * 批量删除销假申请
     * 
     * @param cancellationRequestIds 需要删除的销假申请主键
     * @return 结果
     */
    @Override
    public int deletePerLeaveCancellationRequestsByCancellationRequestIds(Long[] cancellationRequestIds)
    {
        return perLeaveCancellationRequestsMapper.deletePerLeaveCancellationRequestsByCancellationRequestIds(cancellationRequestIds);
    }

    /**
     * 删除销假申请信息
     * 
     * @param cancellationRequestId 销假申请主键
     * @return 结果
     */
    @Override
    public int deletePerLeaveCancellationRequestsByCancellationRequestId(Long cancellationRequestId)
    {
        return perLeaveCancellationRequestsMapper.deletePerLeaveCancellationRequestsByCancellationRequestId(cancellationRequestId);
    }
}
